using System;

namespace PlugNT.Cms.Model
{



    public class UserInfo
    {


        private System.Collections.Generic.Dictionary<string, object> dictab = null;


        public UserInfo()
        {
            dictab = new System.Collections.Generic.Dictionary<string, object>();
        }





        public System.Collections.Generic.Dictionary<string, object> GetDictionary()
        {
            return dictab;
        }







        public bool AddField(string fieldName, object objValue)
        {
            bool addFalg = false;
            if (!dictab.ContainsKey(fieldName))
            {
                dictab.Add(fieldName, objValue);
                addFalg = true;
            }
            return addFalg;
        }







        public bool SetField(string fieldName, object objValue)
        {
            bool setFalg = false;
            if (dictab.ContainsKey(fieldName))
            {
                dictab[fieldName] = objValue;
                setFalg = true;
            }
            return setFalg;
        }






        public string GetFieldToString(string fieldName)
        {
            object objValue = GetField(fieldName);
            return (objValue == null) ? "" : objValue.ToString();
        }






        public object GetField(string fieldName)
        {
            object objValue = null;
            dictab.TryGetValue(fieldName, out objValue);
            return objValue;
        }


    }
}

